<template>
  <div id="Bar-bgc">

  </div>
</template>

<script lang="ts">
export default {
  mounted() {
    this.echarts()
  },
  methods: {
    echarts() {
      let myChart = this.$echarts.init(document.getElementById('Bar-bgc'))
      myChart.setOption({
        title: {
          text: '各周期碳排放详情',
          textStyle: {
            color: 'white'
          }
        },
        xAxis: {
          type: 'category',
          data: ['原材料获取', '生产制造', '分销零售', '使用', '废弃处置'],
          axisLine: {
            lineStyle: {
              color: 'white',
              width: 2
            }
          },
        },
        yAxis: {
          type: 'value',
          axisLine: {
            lineStyle: {
              color: 'white',
              width: 2
            }
          },
        },
        series: [
          {
            data: [320, 80, 120, 150, 140],
            type: 'bar',
            showBackground: false,
            backgroundStyle: {
              color: 'rgba(180, 180, 180, 0.2)'
            }
          }
        ]
      });
    }
  },
}
</script>

<style scoped>
#echartsID {
  width: 90%;
  height: 80%;
}
</style>
